package org.example;

import java.util.Scanner;

public class Test1
{
    public static void main(String[] args)
    {
        //获取用户的键盘输入
        Scanner scanner = new Scanner(System.in);

        while (true)
        {
            //提示用户输入一个正整数
            System.out.println("请输入一个非负整数：");

            //读取用户输入的整数
            int number = scanner.nextInt();
            //判断输入的整数是否为N
            if (number >= 0)
            {
                //打印输入整数的每一位
                printEveryBitOfTen(number);
                break;
            }
            else
            {
                System.out.print("error\n");
            }
        }
    }

    private static void printEveryBitOfTen(int num)
    {
        do
        {
            System.out.print(num % 10);
            System.out.print(" ");
            num /= 10;
        } while (num > 0);
    }
}